package com.example.myblog.service;

import com.baomidou.mybatisplus.core.conditions.update.UpdateWrapper;
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
import com.example.myblog.entity.BlogMessage;
import com.baomidou.mybatisplus.extension.service.IService;
import com.example.myblog.exception.BaseException;
import com.example.myblog.result.BaseCodeEnum;

import java.util.List;
import java.util.Map;

/**
 * <p>
 * 博客基本信息 服务类
 * </p>
 *
 * @author 叶兴
 * @since 2022-09-29
 */
public interface BlogMessageService extends IService<BlogMessage> {
    String selectBlogMessageId(String username);

    int insertBlogMessage(BlogMessage blogMessage);

    boolean ifBlogExists(String blogId);

    int updateBlogMessageLikes(String blogId, String username) throws BaseException;

    int updateBlogMessageComments(String blogId,String username) throws BaseException;

    List<BlogMessage> getAllBlogs() throws BaseException;

    Map<String,Object> getBlogs(int page) throws BaseException;

    Map<String,Object> getCategoryBlogs(Integer pageNum,String categoryName);
}
